
package pri.syl.xiaowu.websocket.netty.server.handler.core.factory.execution;

import pri.syl.xiaowu.websocket.netty.core.factory.constant.ThreadPoolFactoryConstant;
import pri.syl.xiaowu.websocket.netty.core.factory.execution.ThreadPoolFactoryExecution;
import pri.syl.xiaowu.websocket.netty.server.thread.execution.HttpServerHandshakeThreadExecution;
import io.netty.channel.Channel;
import io.netty.handler.codec.http.FullHttpRequest;

import java.util.concurrent.ThreadPoolExecutor;

/**
 * @Author YunLong
 * @Date 2021/7/18 19:04
 * @Description 握手处理器工厂执行器
 **/
public class HttpServerHandlerFactoryExecution {
    private HttpServerHandlerFactoryExecution() {
    }

    public static void httpServerHandshake(Channel channel, FullHttpRequest request, int maxFramePayloadLength, int readTimeoutMilli) {
        HttpServerHandshakeThreadExecution handshakeThreadExecution = new HttpServerHandshakeThreadExecution(channel, request, maxFramePayloadLength, readTimeoutMilli);
        ThreadPoolExecutor handshakeThreadPool = ThreadPoolFactoryConstant.HTTP_SERVER_HANDSHAKE_THREAD_POOL;
        ThreadPoolFactoryExecution.statsThread(handshakeThreadPool, handshakeThreadExecution);

    }
}
